package shil.use.springboot.logback;

import org.slf4j.ILoggerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class UseSpringbootLogbackApplication {

	private static Logger logger = LoggerFactory.getLogger(UseSpringbootLogbackApplication.class);

	public static void main(String[] args) {
		showLoggerInfo() ;
		useLog4j2();
		SpringApplication.run(UseSpringbootLogbackApplication.class, args);
	}


	static void useLog4j2() {

		logger.trace("logback 输出 trace 日志");
		logger.debug("logback 输出 debug 日志");
		logger.info("logback 输出 info 日志");
		logger.warn("logback 输出 warn 日志");
		logger.error("logback 输出 error 日志");
	}

	static void showLoggerInfo() {
		logger.info("logback 输出 logger name : " + logger.getName());
		logger.error("logback 输出 logger name : " + logger.getName());
		logger.info("logback 输出 logger class name : " + logger.getClass().getName());
		logger.error("logback 输出 logger class name : " + logger.getClass().getName());
	}
}

